import {defineStore} from 'pinia'
import {ref,computed} from 'vue'

import { useCountStore } from './counter';



export const useLoginStore = defineStore('login',()=>{
    const userName = ref('');
    const pwd = ref('');

    const countStore = useCountStore();

    const tripleCount = computed(()=> countStore.doubleCount * 2);


    //action
    function isLogin(){
        if(userName.value=='123456' && pwd.value=='admin'){
            return true;
        }
        return false;
    }

    return{userName,pwd,isLogin,tripleCount}

},{persist:{
    enabled:true
}});